/*
 * memcpy_s.c - Safe memory copy with bounds checking
 */

#include "bounds_check.h"
#include "bounds_check_internal.h"
#include <string.h>

int memcpy_s(void *dest, size_t dest_size, const void *src, size_t count) {
    if (!is_valid_buffer(dest, dest_size) || !is_valid_buffer(src, count)) {
        return BOUNDS_CHECK_INVALID_PARAM;
    }

    if (count > dest_size) {
        return BOUNDS_CHECK_BUFFER_TOO_SMALL;
    }

    memcpy(dest, src, count);
    return BOUNDS_CHECK_SUCCESS;
}